package ssl

import (
	"sieve_admin_server_userpass/lib/aliyun"
	"sieve_admin_server_userpass/lib/config"
)

var (
	fEndpoint = config.String("aliyun.ssl.endpoint", "cas.aliyuncs.com", "阿里云 CAS API域名")
)

type DescribePackageStateResp struct {
	IssuedCount int
	RequestId   string
	TotalCount  int
	UsedCount   int
}

func DescribePackageState() (*DescribePackageStateResp, error) {
	resp := &DescribePackageStateResp{}
	if err := aliyun.ReqApi(*fEndpoint, "DescribePackageState", map[string]any{
		"Version": "2020-04-07",
	}, resp); err != nil {
		return nil, err
	}
	return resp, nil
}
